
/*
 * 商品展示
 * @author liuhongjun
 * */
$(function(){
	var $list = $(".classify");
	var items = [];
	var classifyId = ['meat','vegetable'];
	var i = 0;
		$list.find('li').each(function(){
			items.push($(this).html());
		});
		
		$(".classify li").eq(0).html("<font color='red'>"+items[0]+"</font>");
			
		$(".classify li").each(function(index){
				
				$(this).click(function(){
					if(i != index ){
						$("#"+classifyId[index]).css("display","block");
						$("#"+classifyId[i]).css("display","none");
						
						$("#classify_location").html(items[index]);
						$(".classify li").eq(index).html("<font color='red'>"+items[index]+"</font>");
						$(".classify li").eq(i).html("<font color='black'>"+items[i]+"</font>");
						
						i = index;
						}
					});
			});
}); 


/*
 * 今日特推商品
 * liuhongjun
 * */
$(function(){
	var _speed=30;
	var _slide = $("#slide");
	var _slideli1 = $(".slideli1");
	var _slideli2 = $(".slideli2");
	_slideli2.html(_slideli1.html());
	//两秒后调用
	var sliding=setInterval(Marquee,_speed)
	_slide.hover(function() {
		//鼠标移动DIV上停止
		clearInterval(sliding);
	},function(){
		//离开继续调用
		sliding=setInterval(Marquee,_speed);
	});
	function Marquee(){
		if(_slide.scrollLeft() >= _slideli1.width())
			_slide.scrollLeft(0);
		else{
			_slide.scrollLeft(_slide.scrollLeft()+1);
		}
	}
});
function doBasketOn(){
	$("#basket").css("display", "block");
}
function doBasketOff(){
	$("#basket").css("display", "none");
}
